import service from "@/service";

//查询列表
export function getACListData(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleItemConfig/getACListData?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

// 合计
export function getACTotalData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleItemConfig/getACTotalData`,
    method: "POST",
    data,
  });
}

//子页面任务清单列表
export function getACRWList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleItemConfig/getACRWList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

// 【计划管理】列表
export function getListData(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/getListData?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//【计划管理】删除数据
export function deleteData(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/deleteData?id=${id}`,
    method: "POST",
  });
}

//【计划管理】查询审批记录
export function approveRecord(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/approveRecord?id=${id}`,
    method: "POST",
  });
}

// 【计划管理】列表页面提交
export function listSubmitData(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/submitData?id=${id}`,
    method: "POST",
  });
}

// 【计划管理】列表页面撤回
export function listCancleData(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/cancleData?id=${id}`,
    method: "POST",
  });
}

// 【计划管理】列表页面新增按钮权限
export function addButtonFlag(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/addButton`,
    method: "POST",
  });
}

//【计划管理】子页面任务清单列表
export function getRWList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/getRWList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//【计划管理】子页面查看详情
export function getDetail(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/getDetail?id=${id}`,
    method: "POST",
    data,
  });
}

//【计划管理】 模板下载
export function dlImportPlanTemplate(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/dlImportPlanTemplate`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//【计划管理】保存或提交任务单
export function saveOrUpdateData(data) {
  let { submitType } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/saveOrUpdateData?submitType=${submitType}`,
    method: "POST",
    data,
  });
}

//【计划管理】查询流程
export function getFlowNode(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/getFlowNode?id=${id}`,
    method: "POST",
  });
}

// 【计划管理】审批数据
export function approveData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/approveData`,
    method: "POST",
    data,
  });
}

//【计划管理】批量导入
export function importPlanExcel(data, submitType) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/importPlanExcel?submitType=${submitType}`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}

//【计划管理】查看页面梁号下拉框接口
export function getComponentPartsSelect(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/schedulePlanMain/getComponentPartsSelect`,
    method: "GET",
    params,
  });
}

//【进度反馈】查看页面梁号下拉框接口
export function getComponentPartsJDSelect(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleItemConfig/getComponentPartsJDSelect`,
    method: "POST",
    data,
  });
}
